Use this class to access the Windows registry in a Server Watch plugin. The class is designed to help abstract out the complexity of the Windows registry, and its use allows us to control the data in the registry and insulate your plugin's registry settings from changes to how the registry is handled in Server Watch.
|
Public Member Functions |
|
| DFRegTool () |
virtual | ~DFRegTool () |
|
LONG | OpenKey () |
LONG | OpenKey (const CAtlString &) |
LONG | OpenKey (const std::wstring &) |
LONG | OpenKey (const TCHAR *) |
LONG | OpenKey (DWORD &) |
LONG | OpenKey (const CAtlString &, DWORD &) |
LONG | OpenKey (const std::wstring &, DWORD &) |
LONG | OpenKey (const TCHAR *, DWORD &) |
LONG | CloseKey () |
|
LONG | AddDword (LPCTSTR key, DWORD value) |
|
Stores the numeric value of the key/value pair as a simple DWORD in the registry. The variable type of the value can be retrieved as one of a many types, but the user should take care so as not to retrieve a value from the registry and put it into a variable smaller than required or the value will be truncated.
|
LONG | GetDword (LPCTSTR key, DWORD &value) |
LONG | GetDword (LPCTSTR key, int &value) |
LONG | GetDword (LPCTSTR key, bool &value) |
|
Stores the string value of the key/value pair as a simple human readable unicode string. The variable type of the value can be one of a many types.
|
LONG | AddStr (LPCTSTR key, LPCTSTR value) |
LONG | AddStr (LPCTSTR key, const CAtlString &value) |
LONG | AddStr (LPCTSTR key, const std::wstring &value) |
LONG | GetStr (LPCTSTR key, LPTSTR, DWORD value) |
LONG | GetStr (LPCTSTR key, CAtlString &value) |
LONG | GetStr (LPCTSTR key, std::wstring &value) |
|
Stores the string value of the key/value pair in an encoded format. The encoding is basic and should not be considered secure. The variable type of the value can be one of a many types.
- Code Numbers
- The values passed into codeA and codeB when the string is set must be the same values passed into the call to GetCodedStr() to fetch the string of the value returned will not be correct.
|
LONG | AddCodedStr (LPCTSTR key, const CAtlString &value, int codeA, int codeB) |
LONG | AddCodedStr (LPCTSTR key, const std::wstring &value, int codeA, int codeB) |
LONG | AddCodedStr (LPCTSTR key, const TCHAR *value, int codeA, int codeB) |
LONG | GetCodedStr (LPCTSTR key, CAtlString &value, int codeA, int codeB) |
LONG | GetCodedStr (LPCTSTR key, std::wstring &value, int codeA, int codeB) |
|
LONG | DeleteContents () |
LONG | DeleteFolder (LPCTSTR) |
LONG | DeleteKey (LPCTSTR) |
|
LONG | Replicate (const DFRegTool &) |
|
LONG | NextKey (CAtlString &strFileName, int iSetBack=0) |
LONG | NextKey (std::wstring &strFileName, int iSetBack=0) |
LONG | NextValue (CAtlString &strValueName, int iSetBack=0) |
LONG | NextValue (std::wstring &strValueName, int iSetBack=0) |
|
LONG | BeginExportToXML () |
LONG | ExportKeyToXML (LPCTSTR szKeyName, DFRegTool ®Key) |
LONG | EndExportToXML (LPCTSTR szFileName) |
LONG | BeginImportFromXML (LPCTSTR szFileName) |
LONG | ImportFromXML (LPCTSTR szKeyName, CXMLReg &xmlImport) |
LONG | EndImportFromXML () |
CXMLReg * | GetXMLImporter () |
CXMLReg * | GetXMLExporter () |
Protected Types |
enum | FetchType { Readable,
Encoded,
Whole
} |
Protected Member Functions |
LONG | DeleteHelper (HKEY hParentKey) |
LONG | ExportHelper (CXMLReg &xmlFile, HKEY hCurrentKey) |
LONG | ImportHelper (CXMLReg &xmlFile, HKEY hCurrentKey) |
LONG | ReplicateHelper (HKEY hParentKey, HKEY hCopyFromParentKey) |
LONG | GetStrInternal (HKEY hKey, LPCTSTR string, std::wstring &lpszData, FetchType type) |
LONG | GetDwordInternal (HKEY hKey, LPCTSTR string, DWORD &dwWord) |
Protected Attributes |
CAtlString | BasePath |
HKEY | m_hIp |
CXMLReg * | m_xmlExportFile |
CXMLReg * | m_xmlImportFile |